#include "GameObject.h"

GameObject::GameObject(): cellPositionX(0), cellPositionY(0)
{
}

GameObject::~GameObject()
{
	Clear();
}

void GameObject::Clear()
{
	abilities.clear();
}

void GameObject::Accept(GameAbilityVisitor& visitor)
{
	std::list<GameAbility*>::iterator it;


	for(it = abilities.begin(); it != abilities.end(); ++it)
	{
		(*it)->Accept(visitor);
	}
}

void GameObject::AddAbility(GameAbility* ability)
{
	abilities.push_back( ability );
}

unsigned int GameObject::CellX() const
{
	return cellPositionX;
}

unsigned int GameObject::CellY() const
{
	return cellPositionY;
}

void GameObject::SetPosition(unsigned int cellX, unsigned int cellY)
{
	cellPositionX = cellX;
	cellPositionY = cellY;
}
